import config from "@/config"
import http from "@/utils/request"
export default {
    Catalog: {
        detail: {
            url: `${config.API_URL}/main/meta/catalog/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/meta/catalog/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/meta/catalog/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },

        parentTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "元数据目录树状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
    },
    module: {
        add: {
            url: `${config.API_URL}/core/meta/module/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/core/meta/module/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/core/meta/module/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' }});
            }
        },
        update: {
            url: `${config.API_URL}/core/meta/module/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' }});
            }
        },
        parentTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "元数据目录树状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        searchConfigPath: {
            url: `${config.API_URL}/core/meta/module/searchConfigPath`,
            name: "配置路径目录",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        createModuleDirectory: {
            url: `${config.API_URL}/core/meta/module/createModuleDirectory`,
            name: "创建目录",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        deleteModuleDirectory: {
            url: `${config.API_URL}/core/meta/module/deleteModuleDirectory`,
            name: "删除目录",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        businessruleAdd: {
            url: `${config.API_URL}/core/meta/businessrule/base/add`,
            name: "初始化业务规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        businessruleSave: {
            url: `${config.API_URL}/core/meta/businessrule/base/save`,
            name: "保存业务规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
    },
    table: {
        add: {
            url: `${config.API_URL}/core/meta/table/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/core/meta/table/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/core/meta/table/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/core/meta/table/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        getTableSchema: {
            url: `${config.API_URL}/core/meta/table/getTableSchema`,
            name: "获取表结构",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        erDiagramDesigner: {
            url: `${config.API_URL}/core/meta/table/erDiagramDesigner`,
            name: "er图初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        saveErDiagram: {
            url: `${config.API_URL}/core/meta/table/saveErDiagram`,
            name: "er图初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        }
        
    },
    pageTemplate: {
        add: {
            url: `${config.API_URL}/core/meta/pageTemplate/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/core/meta/pageTemplate/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,  config);
            }
        },
        save: {
            url: `${config.API_URL}/core/meta/pageTemplate/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,{ headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },
        update: {
            url: `${config.API_URL}/core/meta/pageTemplate/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },
        searchConfigFiles: {
            url: `${config.API_URL}/core/meta/module/searchConfigFiles`,
            name: "搜索系统下配置路径及文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,  config);
            }
        },
        initAddFile: {
            url: `${config.API_URL}/core/meta/module/initAddFile`,
            name: "初始化添加文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        saveOrupdateFile: {
            url: `${config.API_URL}/core/meta/module/saveOrupdateFile`,
            name: "保存及更新文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        deleteFile: {
            url: `${config.API_URL}/core/meta/module/deleteFile`,
            name: "删除文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        readFileContent: {
            url: `${config.API_URL}/core/meta/module/readFileContent`,
            name: "读取文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
    },
    reportDesigner: {
        add: {
            url: `${config.API_URL}/core/report/reportDesigner/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/core/report/reportDesigner/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/core/report/reportDesigner/saveBaseData`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,{ headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },
        update: {
            url: `${config.API_URL}/core/report/reportDesigner/updateBaseData`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,{ headers: { 'Content-Type': 'multipart/form-data' } });
            }
        },
        queryDatasetList: {
            url: `${config.API_URL}/core/report/importExcel/config/queryDatasetList`,
            name: "获取表结构",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        }
    },
    blockDesigner: {
        add: {
            url: `${config.API_URL}/core/meta/blocksDesiginer/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/core/meta/blocksDesiginer/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/core/meta/blocksDesiginer/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        test: {
            url: `/dev-api`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        
        update: {
            url: `${config.API_URL}/core/meta/blocksDesiginer/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        readBlocksFile: {
            url: `${config.API_URL}/core/meta/blocksDesiginer/readBlocksFile`,
            name: "读取区块文件内容",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        saveBlocksFile: {
            url: `${config.API_URL}/core/meta/blocksDesiginer/saveBlocksFile`,
            name: "保存区块文件内容",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        
    },
    chartDesigner: {
        getDatasetIdList: {
            url: `${config.API_URL}/core/report/chartDesigner/getDatasetIdList`,
            name: "获取数据集列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        getChartFieldList: {
            url: `${config.API_URL}/core/report/chartDesigner/getChartFieldList`,
            name: "获取字段",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        queryChartData: {
            url: `${config.API_URL}/core/report/chartDesigner/queryChartData`,
            name: "数据",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        update: {
            url: `${config.API_URL}/core/meta/blocksDesiginer/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
    businessrule: {
        add: {
            url: `${config.API_URL}/core/meta/businessrule/base/add`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/core/meta/businessrule/base/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/core/meta/businessrule/base/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        update: {
            url: `${config.API_URL}/core/meta/businessrule/base/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        jsonOutline: {
            url: `${config.API_URL}/core/meta/businessrule/base/jsonOutline`,
            name: "树形图数据",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        methodList: {
            url: `${config.API_URL}/core/meta/businessrule/method/list`,
            name: "方法列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        updateMethodList: {
            url: `${config.API_URL}/core/meta/businessrule/method/save`,
            name: "更新方法列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        getCodeList: {
            url: `${config.API_URL}/core/meta/businessrule/code/list`,
            name: "编码规则列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        addCode: {
            url: `${config.API_URL}/core/meta/businessrule/code/add`,
            name: "初始化编码规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        saveOrUpdateCode: {
            url: `${config.API_URL}/core/meta/businessrule/code/saveOrUpdate`,
            name: "保存或更新编码规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        detailCode: {
            url: `${config.API_URL}/core/meta/businessrule/code/detail`,
            name: "查看编码规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        deteleCode: {
            url: `${config.API_URL}/core/meta/businessrule/code/delete`,
            name: "删除编码规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        getValidatorList: {
            url: `${config.API_URL}/core/meta/businessrule/validator/list`,
            name: "验证规则列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        addValidator: {
            url: `${config.API_URL}/core/meta/businessrule/validator/add`,
            name: "初始化验证规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        saveOrUpdateValidator: {
            url: `${config.API_URL}/core/meta/businessrule/validator/saveOrUpdate`,
            name: "保存或更新验证规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        detailValidator: {
            url: `${config.API_URL}/core/meta/businessrule/validator/detail`,
            name: "查看验证规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        deteleValidator: {
            url: `${config.API_URL}/core/meta/businessrule/validator/delete`,
            name: "删除验证规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        getDataList: {
            url: `${config.API_URL}/core/meta/businessrule/data/list`,
            name: "数据规则列表",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        addData: {
            url: `${config.API_URL}/core/meta/businessrule/data/add`,
            name: "初始化数据规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        saveOrUpdateData: {
            url: `${config.API_URL}/core/meta/businessrule/data/saveOrUpdate`,
            name: "保存或更新数据规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        detailData: {
            url: `${config.API_URL}/core/meta/businessrule/data/detail`,
            name: "查看数据规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        deteleData: {
            url: `${config.API_URL}/core/meta/businessrule/data/delete`,
            name: "删除数据规则",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
}